/* jshint indent: 2 */

module.exports = function(sequelize, DataTypes) {
  return sequelize.define('menu', {
    id: {
      type: DataTypes.INTEGER(11).UNSIGNED,
      allowNull: false,
      primaryKey: true,
      autoIncrement: true
    },
    parentid: {
      type: DataTypes.INTEGER(11),
      allowNull: false,
      defaultValue: '0'
    },
    menuname: {
      type: DataTypes.STRING(20),
      allowNull: false,
      defaultValue: ''
    },
    menuicon: {
      type: DataTypes.STRING(50),
      allowNull: false,
      defaultValue: ''
    },
    menupath: {
      type: DataTypes.STRING(100),
      allowNull: false,
      defaultValue: ''
    },
    menu_level: {
      type: DataTypes.INTEGER(1),
      allowNull: false,
      defaultValue: '1'
    },
    createdAt: {
      type: DataTypes.DATE,
      allowNull: false,
      defaultValue: sequelize.literal('CURRENT_TIMESTAMP')
    },
    updatedAt: {
      type: DataTypes.DATE,
      allowNull: false,
      defaultValue: sequelize.literal('CURRENT_TIMESTAMP')
    }
  }, {
    tableName: 'menu'
  });
};
